home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / games2 / graala.lha / Editor.text < prev    next >
Text File  |  1996-05-09  |  20KB  |  488 lines

  1.  
  2.  
  3.  
  4.  
  5.                          The GRAAL Script Editor
  6.                          =======================
  7.  
  8.  
  9. Introduction
  10. ------------
  11.  
  12. This is a neat little (well, not that small, actually) editor, making life
  13. in the GRAAL script-writing lane much easier than it otherwise would be.
  14.  
  15. At first, you may find the concept behind it all slightly confusing. While
  16. other "user-friendly" games development systems opt for point-and-click
  17. control of everything, GRAAL is still only made up of ASCII scripts that
  18. can be created using any text editor. The GRAAL editor is just a helping
  19. hand, making entry of some of the trickier statements a lot easier. The end
  20. result is the same as you would get with any other editor, though - ASCII
  21. script files with lists of GRAAL statements and commands.
  22.  
  23. Why, then, should you use the GRAAL editor, and not any other editor?
  24.  
  25. * It handles multiple scripts in multiple windows with easy switching, 
  26.   copying and pasting between them.
  27.  
  28. * It gives help on the syntax of statements and commands.
  29.  
  30. * It performs basic syntax checking. It doesn't mean you won't get some
  31.   run-time errors in GRAAL, but not the really stupid ones caused by
  32.   obvious typing errors.
  33.  
  34. * It simplifies coding and editing of object, image, exit, and floor
  35.   related statements.
  36.  
  37. * Although many features are GRAAL-related, it is perfectly possible to use
  38.   this editor to edit any kind of ASCII text file. You will probably find
  39.   it a good alternative. Enjoy!
  40.  
  41. * It handles files up to 5000 lines long. (If you have GRAAL scripts that
  42.   long, you are probably in need of professional help :-)
  43.  
  44.  
  45.  
  46.  
  47. System Requirements
  48. -------------------
  49.  
  50. This editor needs Workbench 2.0 or better to work.
  51.  
  52. On AGA machines, it "clones" your Workbench setting, so if you have a
  53. hi-res Workbench, it uses a hi-res screen; with a Productivity Workbench, it
  54. opens in Productivity mode... you get the picture. Just make sure that your
  55. Workbench is at least 640 pixels wide, and everything should operate
  56. smoothly. On non-AGA machines, a normal hi-res, non-interlaced screen is
  57. used.
  58.  
  59. Also note that the editor must be placed in your game development library
  60. on your hard disk for all file fetching routines to operate without problems.
  61.  
  62.  
  63.  
  64. Known bugs
  65. ----------
  66.  
  67. * Sometimes when you re-size a window other than the currently active, the
  68.   display in that window becomes corrupted. Put the window in front and
  69.   activate before re-sizing, this should help you avoid any problems. In
  70.   most cases, you are better off using the "Select Window" functions to
  71.   switch between windows, anyway.
  72.  
  73. * Marking a block that extends over the last actual text line in a file may
  74.   cause problems. Avoid.
  75.  
  76. * The ASL file requester which so conveniently filters out files you do not
  77.   want to see only works on AGA machines - non-AGA machines use the Blitz2
  78.   standard file requester. (This is because I couldn't get the ASL requester
  79.   to open on the GRAAL Editor screen on WB 2.05 - it kept popping up on the
  80.   Workbench screen no matter what, which was very irritating to say the
  81.   least.)
  82.  
  83. * .scene and .ptrn file templates have some commented-out statements in
  84.   them, indicating these statements can optionally included in yous scripts.
  85.   As you know if you have read the GRAAL documentation, .scene and .ptrn
  86.   files do not contain statements at all, so thing is plain wrong. Sorry
  87.   'bout that. Will fix this in the next release!
  88.  
  89.  
  90.  
  91.  
  92.                          WORKING WITH THE EDITOR
  93.                          =======================
  94.  
  95.  
  96.  
  97. Creating a New Script
  98. ---------------------
  99.  
  100. Since the editor expects to be placed in your GRAAL development directory, 
  101. it checks for a graal.main file in the current directory at start-up -
  102. without such a file, you don't really have much of a development environment!
  103.  
  104. If there is no graal.main file, the editor asks if one should be created.
  105. If you answer "yes", a template for such a script will be created in the
  106. editing window (which makes up the main part of the editor display).
  107.  
  108. You can also use the "New" option in the "Project" menu to create a new
  109. file. The "New" option has six suboptions. The first one, "empty", just
  110. opens a new, empty editing window on top of the first one. The editor
  111. handles up to ten script windows simultaneously, and you can switch
  112. between them quite easily with the "Select Window" option in the "Edit" menu
  113. (or <Amiga>+<W>).
  114.  
  115. The next three suboptions, "graal.main", ".room", and ".section" opens a
  116. new window and places a template for the selected script type there. The
  117. last two suboptions are for ".scene" and ".ptrn" scripts respectively, and
  118. do not have templates.
  119.  
  120. Note the file name stated in the top border of the window - for all script
  121. types, the file name is (partly) created when you select "New". However, 
  122. .room, .section, .scene, and .ptrn files are not numbered, so you need
  123. to supply the correct number before the type suffix. This means the first
  124. time you save the file, use the "Save As" option in the "Project" menu.
  125. Once the file name is correct, you can use the "Save" option instead.
  126.  
  127.  
  128.  
  129. Loading Existing Scripts
  130. ------------------------
  131.  
  132. Just like the "New" option, the "Load" option (also in the "Project" menu)
  133. has a number of suboptions. The only thing they do is make the file
  134. requester show only the correctly named files. For example, the ".room"
  135. suboption only brings up a list of all ".room" files, making the search
  136. for the correct script quicker and easier. The "general" suboption shows
  137. all the files in the directory.
  138.  
  139. Most of the time, you probably want to open a script in a new window, which
  140. is why you should use the "Open & Load" option instead. In this case, the
  141. suboptions have keyboard shortcuts (<amiga>+<3-8>). Learn to use them, as
  142. this is the quickest way to open scripts.
  143.  
  144.  
  145.  
  146. The Templates and the Syntax Checker
  147. ------------------------------------
  148.  
  149. Some statements in the templates have some suggested parameters already
  150. filled in. In most cases there is no point in giving a suggestion, though, 
  151. because the correct parameters are very much up to yourself. You can see
  152. this quite easily: Create a new graal.main script, making the editor give
  153. you a graal.main template. Now press the button marked "Syntax". This will
  154. make the editor check the script in the current window for syntax errors, 
  155. and it will not be very long before it comes upon a statement with no
  156. parameter filled in. It then displays an error message telling you about
  157. the problem, and it also marks the statement where the error occurs.
  158.  
  159. The syntax checker is a great help, but it does not find every possible
  160. error. This is what it does:
  161.  
  162. * The names of all statements are checked.
  163.  
  164. * It checks that all mandatory statements are in place. However, note that
  165.   some statements may depend on others to work, and this is not checked by
  166.   this function. Be particularly careful with graphics, and make sure the
  167.   correct CLPART: statement is in effect in every situation requiring
  168.   CLPART pictures!
  169.  
  170. * The number of parameters for all statements are checked (except for
  171.   statements with a variable number of parameters).
  172.  
  173. * For all parameters that may consist of conditions, commands, or both, 
  174.   the name of each condition and command is checked.
  175.  
  176. If any error is found, the offending statement / command is highlighted, 
  177. and the nature of the error is shown in a requester as described above.
  178.  
  179. Note: The syntax checker uses the file name suffix to determine what
  180. statements and commands are allowed - so it can only be used in files
  181. following the GRAAL naming conventions.
  182.  
  183. All this should make development a little less frustrating. However, GRAAL
  184. itself checks a lot of other stuff too, and will still throw runtime errors
  185. at you from time to time. Further improvements will probably appear over
  186. time.
  187.  
  188.  
  189.  
  190. Syntax Help
  191. -----------
  192.  
  193. If you place the cursor on a statement or command word and press the HELP
  194. key, a simple syntax help is shown in the screen title bar. Explanations:
  195.  
  196. [...]         This part is optional
  197.  
  198. UPPERCASE     This parameter must be typed as shown here.
  199.  
  200. ...|...       A separator separating alternative options for the parameter.
  201.  
  202. {...}         This parameter is repetitive. E.g., {command|condition} means
  203.               any number of GRAAL commands and/or conditions, separated
  204.               by semi-colons, may be placed here.
  205.  
  206. ...|list      This parameter may be list of values like the one on the
  207.               left hand side of the | character - the values in the list
  208.               must be separated by | characters.
  209.  
  210. Note that after having run the syntax checker, the cursor is placed on the
  211. failing statement or command, which means you can press <help> immediately
  212. for further information.
  213.  
  214. Also note that like the syntax checker, the help function uses the file
  215. name suffix to determine what statements and commands are allowed - so it
  216. can only be used in files following the GRAAL naming conventions.
  217.  
  218. If further help is required, refer to the graal.guide on-line reference.
  219.  
  220.  
  221.  
  222. Normal Editing Functions
  223. ------------------------
  224.  
  225. I will not bother you too much about the functions that you are likely
  226. to encounter in any text editor. You should find the find & replace options, 
  227. and the other options of the "Edit" menu, quite adequate for the job at hand.
  228.  
  229. Just a few words about useful keyboard keys:
  230.  
  231. <shift>+<down arrow>
  232. <shift>+<up arrow>      These keys scrolls the script one page at a time.
  233.  
  234. <shift>+<right arrow>   Moves the cursor past the last character of the line.
  235.  
  236. <shift>+<left arrow>    Moves the cursor to the beginning of the line.
  237.  
  238. <control>+<right arrow> Moves to the next semi-colon of the line; that is, 
  239.                         to the next GRAAL statement parameter.
  240.  
  241. <esc>                   Close the current window.
  242.  
  243. <enter>                 Exit a string gadget (for example, in the Find
  244.                         window), or carry out a function (for example, 
  245.                         "Find" in the find window, once the cursor is not
  246.                         in a string gadget anymore).
  247.  
  248. Other available shortcut keys are all listed in the menus.
  249.  
  250.  
  251.  
  252. Marking Text Using the Mouse
  253. ----------------------------
  254.  
  255. Apart from marking text blocks with <amiga>+<1> and <amiga>+<2>, you can use
  256. the mouse:
  257.  
  258. 1   Click the first character of the block.
  259.  
  260. 2   Hold down a <shift> key and click the character immediately to the right
  261.     of the last character of the block. (Clicking the first character of a
  262.     will mark the entire previous line.)
  263.  
  264.  
  265.  
  266. The Status Bar
  267. --------------
  268.  
  269. Some useful bits of information are shown in the "status bar" immediately
  270. above the editing windows:
  271.  
  272. 1   Cursor row (r) and column (c) position.
  273.  
  274. 2   Insert (I) or overstrike (O) write mode.
  275.  
  276. 3   Number of changes made since the last save. Note that some "big"
  277.     operations, like inserting a block of text, only count as one change
  278.     each!
  279.  
  280. 4   Time. The clock is only updated when you do something in the editor, 
  281.     like moving the cursor.
  282.  
  283.  
  284.  
  285. Switching between Windows
  286. -------------------------
  287.  
  288. When writing GRAAL scripts, you very often need to make changes to two or
  289. more script files almost simultaneously. Fortunately, the GRAAL editor
  290. really excels at this.
  291.  
  292. Use <amiga>+<w> to open a window containing a list of all currently open
  293. editing windows and their contents. In addition, all windows where unsaved
  294. changes exist are marked with an asterisk ( * ) before the window number.
  295.  
  296. Click on any name in the list, and that window will become active and placed
  297. on top of the other windows. You can also use the cursor keys and select
  298. a window with the <enter> key. In fact, the GRAAL text editing functions
  299. have been designed to make as little use of the mouse as possible - the
  300. keyboard is much faster once you get accustomed to using all shortcut keys.
  301.  
  302. If you need to view more than one script at the same time, just resize the
  303. editing windows and place them next to each other - nothing could be simpler.
  304. (Though I must confess I don't use this much myself - window switching is
  305. so much easier!)
  306.  
  307.  
  308.  
  309.                             THE STATEMENT EDITORS
  310.                             =====================
  311.  
  312. The Statement Editors are a bunch of functions helping you edit some of the
  313. most complex statements in the GRAAL language.
  314.  
  315.  
  316.  
  317. The Object Editor
  318. -----------------
  319.  
  320. Let's start with the most complex of all, the OBJECT:/ROOMOBJ:/SECTIONOBJ:
  321. statement. This is available both from the "Object" button and the "Edit
  322. Object" option in the "GRAAL" menu.
  323.  
  324. What happens when you choose the option depends on whether the cursor
  325. was placed on an OBJECT: statement line when it was invoked. If so, 
  326. the parameters of that statement is edited: Otherwise, GRAAL will assume
  327. that you want to create a new object. This means once you save the edits, 
  328. this will create a new OBJECT: statement line at the cursor position.
  329.  
  330. Note: The editor is clever enough to recognise whether you are in a .main, 
  331. .room, or .section script, and will adjust to an OBJECT:, ROOMOBJ:, or
  332. SECTIONOBJ: accordingly. The same goes for the other editors handling
  333. statements which are differently named depending on the script type in
  334. which they appear.
  335.  
  336. Okay, what happens when we call upon the object editor, then? First, we
  337. get a new window, displaying all the object parameters in a much nicer
  338. way than the ordinary statement syntax. Most are represented by string
  339. gadgets which must be properly filled in, a few with fixed options are
  340. represented by text cycle gadgets - click on one of these to cycle through
  341. the possible settings. For example, "Visible:" just switches between
  342. "yes" and "no".
  343.  
  344. If you press the <OK> button, the object editor window closes, and:
  345.  
  346. * If the cursor was on an existing OBJECT: statement, this line will be
  347.   replaced with the updated version.
  348.  
  349. * Otherwise, a new statement line will be inserted at the cursor position.
  350.  
  351. If you press <Cancel>, nothing will happen to the script.
  352.  
  353.  
  354.  
  355. Editing the Object Position On-screen
  356. -------------------------------------
  357.  
  358. The trickiest part of GRAAL coding is getting on-screen coordinates right.
  359. In the object editor, there is a < <-Edit > button next to the string
  360. gadgets dealing with the object position and appearance. Press this, and
  361. you will be able to place the object correctly against the background
  362. picture using the mouse.
  363.  
  364. To achieve this, the editor will ask for two files: First, it asks you to
  365. name a .room file. This is because it is about to create a list of all
  366. available images that you could possibly want to use for the object, and
  367. it need information about the .room file to know which BOB images to load.
  368.  
  369. Next, it asks for the name of the background picture against which you want
  370. to place the object. For example, if you are editing a ROOMOBJ: in room
  371. 1, the two files would probably be "1.room" and "1BG.IFF" (if you follow
  372. the naming standards of my example adventure).
  373.  
  374. By now, the background picture should have appeared on screen. If you are
  375. editing a new statement, the first image fount in the graal.main file is
  376. displayed in the bottom left corner of the picture.
  377.  
  378. Hold the left mouse button down and drag the mouse - the image will follow.
  379. Press the down arrow key - the image shown will change and "cycle through"
  380. all the images found in the graal.main, selected .room and .section scripts.
  381. Simply select the proper image and place it in the proper place in the
  382. picture.
  383.  
  384. If the background picture is wider than the screen, you can scroll it with
  385. the left and right arrow keys.
  386.  
  387. Press <enter> if you wish to save the position, or <esc> to cancel the
  388. operation.
  389.  
  390. If you were editing a new statement, or an old statement which defined
  391. the object image as a single BOB image (not a pattern or an animation
  392. sequence), both the object position and the object image specification will
  393. be updated. When the statement contains an animation sequence or pattern, 
  394. only the position is updated, so as not to spoil any earlier work you may
  395. have put into the specification of the image/animation/pattern.
  396.  
  397.  
  398.  
  399. The BOB Image Editor
  400. --------------------
  401.  
  402. The rest of the editors don't have their own fancy "parameter windows" like
  403. the Object Editor - they simply don't have enough parameters to justify
  404. that. Instead, they only help with the graphical side of things, much like
  405. the "edit position" part of the Object Editor.
  406.  
  407. To illustrate this, the BOB Image Editor is next. It only edits five of the
  408. eight parameters in BOBS:, ROOMBOBS: and SECTIONBOBS: statements: x, y, 
  409. width, height, and x-offset. If you create a new statement with the editor, 
  410. you must make sure to complete the statement by filling in the other three
  411. parameters correctly yourself.
  412.  
  413. The BOB Image Editor also needs the name of a picture file - this is the
  414. "clipart" picture from which the BOB images should be cut out. Before
  415. you invoke the editor, select the proper file name using the "Change Picture"
  416. option in the "GRAAL" menu: All editors will continue to use the same
  417. picture file unless this option is used to change the file name.
  418.  
  419. Once the clipart picture is shown, click and drag the mouse. You should see
  420. a small square move across the picture from the upper left corner: This is
  421. the cut-out frame. Now release the button, select a point in the bottom right
  422. corner of the frame, and drag again. This will re-size the frame. All you
  423. have to do now is place the frame around the image you want, and adjust the
  424. size. Save the information with the <enter> key, which updates, the script.
  425.  
  426. If the ...BOBS: statement says that more than one image should be cut out
  427. (which is specified in the first parameter), a number of horisontally
  428. aligned frames, equal to the number of images being cut out, are shown
  429. agains the clipart picture. Use the leftmost frame to frame the first image.
  430. Then, you can adjust the spacing between the frames with the up and down
  431. arrow keys until each frame is properly placed around its image.
  432.  
  433.  
  434.  
  435. The Exit Editor
  436. ---------------
  437.  
  438. The Exit Editor works much like the BOB Image Editor. Remember that you want
  439. to edit against the proper background picture, so switch to the proper file
  440. with <Change Picture> first!
  441.  
  442. You will see all exits in the room marked as white rectangles, each numbered
  443. with the exit number. All except the one on which the cursor was placed -
  444. this is shown as a resizable, movable frame just like the one in the BOB
  445. Image editor. Place it and re-size it using the mouse.
  446.  
  447. You can also specify the exit point - This is the point which the character
  448. will move to when the MEXIT command is given. It is initially shown as a
  449. small cross-hair in the bottom left corner of the picture. Point to the
  450. cross-hair, and drag it to where you want the exit point.
  451.  
  452. As always, if the picture is larger than the screen, use the left and right
  453. arrow keys to move around.
  454.  
  455.  
  456.  
  457. The Floor Editor
  458. ----------------
  459.  
  460. VERY similar to the Exit Editor, this one - shows all the floors and their
  461. numbers.
  462.  
  463.  
  464.  
  465. The Coordinate Editor
  466. ---------------------
  467.  
  468. There are many other statements and commands requiring object coordinates
  469. at some point. This simple little editor does the trick - it does not
  470. produce full-blown statements or commands, it just inserts x and y
  471. coordinates, separated by commas, at the current cursor position. It allows
  472. you to position any of the available images just like in the Object Editor, 
  473. switching the image used with the up and down arrow keys. Neat or what?
  474. Don't leave home without it!
  475.  
  476.  
  477.  
  478.                              COPYRIGHT INFO
  479.                              ==============
  480.  
  481. The GRAAL Script Editor 1.0 is part of the unregistered GRAAL 1.0 shareware
  482. package. It has been my first project in Blitz 2 Basic and can be used for
  483. any purpose free of charge.
  484.  
  485. Has someone come up with an Amal emulation library for Blitz yet? If so, I
  486. will spend the next year converting GRAAL to Blitz. 256-colour city, here
  487. we come! ( -not- :)
  488.